/*
 * @Author: liuYang codkly@gmail.com
 * @Date: 2022-12-05 17:23:28
 * @LastEditors: liuYang codkly@gmail.com
 * @LastEditTime: 2022-12-08 13:23:46
 * @FilePath: \coding\nest\blog_alpha\src\user\user.entity.ts
 * @Description:
 * 暂无备注
 */
import {
  Column,
  CreateDateColumn,
  DeleteDateColumn,
  Entity,
  PrimaryGeneratedColumn,
  OneToOne,
  JoinColumn
} from 'typeorm';
import { Exclude } from 'class-transformer';
import {BaseEntity} from '../../entity/base.entity'
import {UserinfoEntity} from '../userinfo/userinfo.entity'

@Entity('user')
export class UserEntity extends BaseEntity{

  @Column({
    comment: '邮箱账号',
  })
  email: string;
  
  @Column({
    comment: '名字',
  })
  name: string;

  // @Exclude() //某个请求中不返回
  @Column({
    select: false,
    comment: '密码',
  })
  password: string;

  @OneToOne(() => UserinfoEntity)
  @JoinColumn()
  info: UserinfoEntity;
  
  // @Column({
  //   nullable: true,
  //   comment: '头像',
  // })
  // avatar: string;



  // @Column('mediumtext', {
  //   nullable: true,
  //   comment: '介绍',
  // })
  intro: string;
}
